/*
* @Author: SUDDEV
* @Date:   2017-08-23 18:39:15
* @Last Modified by:   SUDDEV
* @Last Modified time: 2017-09-01 08:27:40
*/
//表单里的错误提示
var formError = {
    show    : function(errorMsg){
        $('#error-message').text(errorMsg).show();
    },
    hide    : function(){
        $('#error-message').text('').hide();
    }
};

//page逻辑部分
var page = {
	// 初始化，获取note数据
    init : function () {
        _info.get_note(function(res){
        	var text = "{{#list}}<tr><td>{{customerId}}</td><td>{{realname}}</td><td>{{sex}}</td><td>{{birthday}}</td><td>{{phone}}</td><td>{{cellphone}}</td><td>{{address}}</td><td>{{startDate}}</td><td>{{memo}}</td></tr>{{/list}}";
            var template = {
                list : res
            }
            var result = _tools.renderHtml(text,template);
            $('.info_table').show();
            $('#info_list').html(result);
        },function(errorMsg){
        	formError.show(errorMsg);
        });
    }
}

$(function () {
   page.init(); 
});